import Vue from 'vue'
import Router from 'vue-router'

import order from '@/views/order'

Vue.use(Router)

export default new Router({
  routes: [
    { path: '/', redirect: '/home' },
    { path: '/home', name: 'home', component: require('@/views/home').default, meta: { keepAlive: true } },
    { path: '/category', name: 'category', component: require('@/views/category').default, meta: { keepAlive: true } },
    { path: '/cart', name: 'cart', component: require('@/views/cart').default,meta:{requireAuth: false} },
    { path: '/checkout', name: 'checkout', component: require('@/views/checkout').default,meta:{requireAuth: true} },
    { path: '/goodsViews', name: 'goodsViews', component: require('@/views/goodsViews').default },
    { path: '/goodsEvaluateLists', name: 'goodsEvaluateLists', component: require('@/views/goodsEvaluateLists').default },
    { path: '/search', name: 'search', component: require('@/views/search').default },

    { path: '/login', name: 'login', component: require('@/views/login').default },

    { path: '/mine', name: 'mine', component: require('@/views/mine').default },
    { path: '/address', name: 'address', component: require('@/views/address').default ,meta:{requireAuth: true}},
    { path: '/addressAdd', name: 'addressAdd', component: require('@/views/addressAdd').default,meta:{requireAuth: true} },
    { path: '/addressEdit', name: 'addressEdit', component: require('@/views/addressEdit').default ,meta:{requireAuth: true}},

    { path: '/order/:active', name: 'order', props: true,component: order ,meta:{requireAuth: true}},
    { path: '/orderViews', name: 'orderViews', component: require('@/views/orderViews').default ,meta:{requireAuth: true}},
    { path: '/orderSuccess', name: 'orderSuccess', component: require('@/views/orderSuccess').default ,meta:{requireAuth: true}},
    { path: '/orderTracker', name: 'orderTracker', component: require('@/views/orderTracker').default ,meta:{requireAuth: true}},
    { path: '/evaluateAddView', name: 'evaluateAddView', component: require('@/views/evaluateAddView').default ,meta:{requireAuth: true}},
    { path: '/serviceAddView', name: 'serviceAddView', component: require('@/views/serviceAddView').default ,meta:{requireAuth: true}},

    { path: '/points', name: 'points', component: require('@/views/points').default,meta:{requireAuth: true} },
    { path: '/pointsGoods', name: 'pointsGoods', component: require('@/views/pointsGoods').default,meta:{requireAuth: true} },
    { path: '/pointsExchange', name: 'pointsExchange', component: require('@/views/pointsExchange').default,meta:{requireAuth: true} },
    { path: '/service', name: 'service', component: require('@/views/service').default ,meta:{requireAuth: true}},
    { path: '/help', name: 'help', component: require('@/views/help').default ,meta:{requireAuth: false}},
    { path: '/helpViews', name: 'helpViews', component: require('@/views/helpViews').default ,meta:{requireAuth: false}},

  ]
})
